#include <REGX52.H>

void showDigit(int loc,num,short dot){
	int n2d[]={0x7f,6,0x5b,0x4f,0x66,0x6d,0x7d,7,0x7f,0x6f};
	P2_4=loc&4;
	P2_3=loc&2;
	P2_2=loc&1;
	P0=n2d[num]|(dot<<7);
}

void main(){
	for(;;){
		showDigit(7,1,0);
		showDigit(6,2,0);
		showDigit(5,3,0);
	};
}